home *** CD-ROM | disk | FTP | other *** search
/ Atari Mega Archive 1 / Atari Mega Archive - Volume 1.iso / gnu / progutil / stdwin.zoo / conf / mkmk < prev    next >
Text File  |  1989-10-17  |  2KB  |  69 lines

  1. #! /bin/sh
  2. # Shell script to create a Makefile from Make.conf and some  standard parts.
  3. #
  4. # *** Add your hostname as a case to the 'case $HOST' statement below. ***
  5. #
  6. # This should be called only from within any of the stdwin subdirectories.
  7. # See the mkdep script for details about the generation of dependency lines.
  8.  
  9. CONF=../conf
  10. export PATH; PATH="$PATH:$CONF" # So the call to make below can find mkdep
  11.  
  12. # Figure out the operating system name.  For now, we use a little table
  13. # keyed to the hostname.  Hey, I'm not Larry Wall! :-)
  14. # You may also set the system type in the environment variable $SYSTEM.
  15.  
  16. HOST=`hostname | sed 's/\..*//'`
  17.  
  18. # On (some?) Suns, arch returns the system type
  19. case $SYSTEM in
  20. '')    if test -f /bin/arch; then SYSTEM=`/bin/arch`; fi;;
  21. esac
  22.  
  23. case $SYSTEM in
  24. '')
  25.     # Add a line for your host(s) to this case statement.
  26.     # The system name is only used to select a file Sys.$SYSTEM
  27.     # below; you can define your own system types if you like.
  28.     case $HOST in
  29.     knoflook|bitter|porter|ober)        SYSTEM=sun;;
  30.     sob|swab|rorb|nop|xor|bis)        SYSTEM=ultrix;;
  31.     piring|sering|boring|turing|zuring)    SYSTEM=bsd43;;
  32.     reel|jive|pogo|tango|joker|gigue)    SYSTEM=bsd42am;;
  33.     *) echo 'Please set SYSTEM in environment or edit mkmk' 1>&2; exit 1;;
  34.     esac
  35.     ;;
  36. esac
  37.  
  38. # Set the names of the variable/optional files;
  39. # replace non-existent ones by /dev/null
  40.  
  41. SYSDEP=$CONF/Sys.$SYSTEM
  42. SITEDEP=$CONF/Site.$HOST
  43.  
  44. if test ! -f $SYSDEP
  45. then
  46.     # Actually not much may work if this file isn't found,
  47.     # so we issue a warning.
  48.     echo "Warning: $SYSDEP not found" >&2
  49.     SYSDEP=/dev/null
  50. fi
  51.  
  52. if test ! -f $SITEDEP
  53. then
  54.     SITEDEP=/dev/null
  55. fi
  56.  
  57. # Create the prototype Makefile by "catting" the different parts.
  58.  
  59. cat $CONF/Generic $SYSDEP $SITEDEP Make.conf $CONF/Rules >@Makefile
  60.  
  61. # 'make depend' calls mkdep for all source files with output to @mkdep.
  62.  
  63. if make -f @Makefile depend
  64. then
  65.     cat @mkdep >>@Makefile
  66.     mv -f @Makefile Makefile
  67.     rm @mkdep
  68. fi
  69.